﻿@using VideoSeller.Business.Data.Enums
@model PersonalViewModel

@{
	ViewBag.Title = Html.GetGlobalResource("PagesTitles", "CabinetPersonal");
	Layout = "~/Views/Shared/_DefaultLayout.cshtml";
}

<script type="text/javascript">
	$(document).ready(function () {
		$("#BirthDate").datepicker({
			showAnim: "fadeIn",
			dateFormat: 'dd MM yy',
			yearRange: "-80:-5",
			firstDay: 1,
			changeMonth: true,
			changeYear: true,
			gotoCurrent: true
		});
	});
</script>

<div class="tabs">
	@Html.Partial("~/Views/Shared/_CabinetTabs.cshtml", CabinetTabs.Personal)
	<div class="tab_content">
		<div class="tab_inner tab_inner_act">
			@using (Html.BeginForm("Personal", "Cabinet", FormMethod.Post))
   {
				<table class="prof_table">
					<tr>
						<td>
							<div id="edit_content" style="display: none;">
								<table class="prof_in_table_main">
									<tr>
										<td title='@Html.GetLocalResource("HiddenForOther")'>@Html.CheckBoxFor(x => x.sFirstName)</td>
										<td>@Html.GetLocalResource("FirstName")</td>
										<td>@Html.TextBoxFor(x => x.FirstName)</td>
									</tr>
									<tr>
										<td title='@Html.GetLocalResource("HiddenForOther")'>@Html.CheckBoxFor(x => x.sLastName)</td>
										<td>@Html.GetLocalResource("LastName")</td>
										<td>@Html.TextBoxFor(x => x.LastName)</td>
									</tr>
									<tr>
										<td title='@Html.GetLocalResource("HiddenForOther")'>@Html.CheckBoxFor(x => x.sBirthDate)</td>
										<td>@Html.GetLocalResource("BirthDate")</td>
										<td>@Html.TextBox("BirthDate", Model.BirthDate.HasValue ? Model.BirthDate.Value.ToString("dd MMMM yyyy") : "")</td>
									</tr>
									<tr>
										<td></td>
										<td>@Html.GetLocalResource("Country")</td>
										<td>@Html.DropDownList("SelectedCountryId", Model.Countries)</td>
									</tr>
									<tr>
										<td></td>
										<td>@Html.GetLocalResource("Sex")</td>
										<td>
											@Html.RadioButton("Sex", Sex.Male, Model.Sex == Sex.Male, new { id = "sexMale" })<label for="sexMale">@Html.GetLocalResource("Male")</label>
											@Html.RadioButton("Sex", Sex.Female, Model.Sex == Sex.Female, new { id = "sexFemale" })<label for="sexFemale">@Html.GetLocalResource("Female")</label>
										</td>
									</tr>
									<tr>
										<td title='@Html.GetLocalResource("HiddenForOther")'>@Html.CheckBoxFor(x => x.sAddress)</td>
										<td>@Html.GetLocalResource("Address")</td>
										<td>@Html.TextAreaFor(x => x.Address)</td>
									</tr>
									<tr>
										<td></td>
										<td>@Html.GetLocalResource("About")</td>
										@*<td>@Html.TextAreaFor(x => x.About)</td>*@
                                        <td class="about_client_info">@Html.TextAreaFor(x => x.About, new { maxlength="245"})</td>
									</tr>
									<tr>
										<td></td>
										<td>@Html.GetLocalResource("HomePage")</td>
										<td>@Html.TextBoxFor(x => x.HomePage)</td>
									</tr>
                                    <tr>
                                        <td><br />@Html.GetLocalResource("ChangePassword")</td>
                                    </tr>
                                    <tr>
										<td></td>
										<td>@Html.GetLocalResource("OldPassword")</td>
										<td>@Html.TextBoxFor(x => x.OldPassword)</td>
									</tr>
                                    <tr>
                                        <td></td>
                                        <td>@Html.GetLocalResource("NewPassword")</td>
                                        <td>@Html.TextBoxFor(x => x.NewPassword)</td>
                                    </tr>
									<tr>
										<td></td>
										<td></td>
										<td>
											<input type="submit" value="@Html.GetLocalResource("Save")"/></td>
									</tr>

								</table>
							</div>
							<div id="read_content">
								<table class="prof_in_table_main">
									<tr>
										<td class="prof_title">@Html.GetGlobalResource("Common", "Login")</td>
										<td>@Model.Login</td>
									</tr>
									<tr>
										<td class="prof_title">@Html.GetLocalResource("FirstName")</td>
										<td>@Model.FirstName</td>
									</tr>
									<tr>
										<td class="prof_title">@Html.GetLocalResource("LastName")</td>
										<td>@Model.LastName</td>
									</tr>
									<tr>
										<td class="prof_title">@Html.GetLocalResource("BirthDate")</td>
										<td>@(Model.BirthDate.HasValue ? Model.BirthDate.Value.ToString("dd MMMM yyyy") : "")</td>
									</tr>
									<tr>
										<td class="prof_title">@Html.GetLocalResource("Country")</td>
										<td>@(Model.Country != null ? Model.Country.Name : string.Empty)</td>
									</tr>
									<tr>
										<td class="prof_title">@Html.GetLocalResource("Sex")</td>
										<td>
											@(Model.Sex == Sex.Male ? @Html.GetLocalResource("Male") : @Html.GetLocalResource("Female"))
										</td>
									</tr>
									<tr>
										<td class="prof_title">@Html.GetLocalResource("About")</td>
										<td  class="about_client_info">@Model.About</td>
									</tr>
									<tr>
										<td class="prof_title">@Html.GetLocalResource("HomePage")</td>
										<td><a href="@Model.HomePage" target="_blank">@Model.HomePage</a></td>
									</tr>
									<tr>
										<td class="prof_title">@Html.GetLocalResource("Language")</td>
										<td>
											@Model.language
										</td>
									</tr>
                                    <tr>
										<td class="prof_title">@Html.GetLocalResource("OnTheSite")</td>
										<td>
											@Model.OnTheSite
										</td>
									</tr>

</table>
							</div>
						</td>
						<td>
							<table class="prof_in_table pit_1"  id="stat1">
								<tr>
									<td>
										<img src='@Url.Content("~/content/images/video_type_free.png")'class="p_stat_top_img"/>
										@Model.m_countAll
										<span class="c_l_fields">@Model.m_Ratin.ToString()</span>

									</td>
								</tr>
								<tr>
									<td></td>
								</tr>

								<tr>
									<td></td>
								</tr>
								<tr>
									<td>
										<img src='@Url.Content("~/content/images/view_a.png")'class="p_stat_img"/>
										@Model.m_Views_anonce
									</td>
								</tr>
								<tr>
									<td>
										<img src='@Url.Content("~/content/images/view.png")' class="p_stat_img"/>
										@Model.m_Views_online
									</td>
								</tr>
								<tr>
									<td>
										<img src='@Url.Content("~/content/images/view_h.png")'class="p_stat_img"/>
										@Model.m_Views_history
									</td>
								</tr>
								<tr>
									<td>
										<img src='@Url.Content("~/content/images/like.png")' class="p_stat_img"/>
										<label class="likeValue">@Model.m_like</label>
									</td>
								</tr>
								<tr>
									<td>
										<img src='@Url.Content("~/content/images/unlike.png")' class="p_stat_img"/>
										<label class="unlikeValue">@Model.m_nlike</label>
									</td>
								</tr>

								<tr>
									<td>
										<img src='@Url.Content("~/content/images/many.png")'class="p_stat_img"/>
										@Html.GetCurrencyString(Model.m_VSM)
									</td>
								</tr>
							</table>
						</td>
						<td>
							<table class="prof_in_table pit_2" id="stat2">
								<tr>
									<td>
										<img src='@Url.Content("~/content/images/video_type_paid.png")'class="p_stat_top_img"/>
										@Model.c_countAll
										<span class="c_l_fieldm">@Model.c_Ratin.ToString()</span>

									</td>
								</tr>
								<tr>
									<td></td>
								</tr>

								<tr>
									<td></td>
								</tr>
								<tr>
									<td>
										<img src='@Url.Content("~/content/images/view_a.png")'class="p_stat_img"/>
										@Model.c_Views_anonce
									</td>
								</tr>
								<tr>
									<td>
										<img src='@Url.Content("~/content/images/view.png")' class="p_stat_img"/>
										@Model.c_Views_online
									</td>
								</tr>
								<tr>
									<td>
										<img src='@Url.Content("~/content/images/view_h.png")'class="p_stat_img"/>
										@Model.c_Views_history
									</td>
								</tr>
								<tr>
									<td>
										<img src='@Url.Content("~/content/images/like.png")' class="p_stat_img"/>
										<label class="likeValue">@Model.c_like</label>
									</td>
								</tr>
								<tr>
									<td>
										<img src='@Url.Content("~/content/images/unlike.png")' class="p_stat_img"/>
										<label class="unlikeValue">@Model.c_nlike</label>
									</td>
								</tr>

								<tr>
									<td>
										<img src='@Url.Content("~/content/images/many.png")'class="p_stat_img"/>
										@Html.GetCurrencyString(Model.c_VSM)
									</td>
								</tr>

							</table>



						</td>

					</tr>
				</table>
   }
			<br />
			<br />
			<a id="switch_to_edit" class="vs_btn" onclick='$("#read_content").hide(); $("#switch_to_edit").hide();$("#stat1").hide();$("#stat2").hide();$("#prof_in_table pit_1").hide();  $("#edit_content").show(); $("#edit_rmv").show(); '>@Html.GetLocalResource("Edit")</a>

			<div id ="edit_rmv" style="display:none;">
			@using (Html.BeginForm("Remove", "Account", new { id = Model.CurrentMembershipUser.UserId }, FormMethod.Post))
   {
				<input type="submit" value="@Html.GetLocalResource("RemoveAccount")"/>
				@Html.HttpMethodOverride(HttpVerbs.Delete)
   }
   </div>
		</div>
	</div>
</div>
